#!/usr/bin/env python  
# encoding: utf-8   

""" 
@version: v1.0 
@author: null 
@software: PyCharm 
@file: mainother.py 
@time: 2017.3.21 20:04 
"""

from collections import OrderedDict
from pyexcel_xls import get_data
from pyexcel_xls import save_data

def read_file():
    xls_data = get_data('./图灵机器人.xlsx')

    for k,v in xls_data.items():
        num = int(len(v)/1000)
        print(num)
        for i in range(num):
            print(i)
            save_file(v[i*1000:(i+1)*1000],str(i))
    pass

def save_file(sheet,file):
    data = OrderedDict()
    data.update({"robot":sheet})
    save_data("./"+file+".xls",data)
    pass

if __name__ == "__main__":
    read_file()
    pass
